﻿@using ZhouYu.DreamTour.Model;
@using ZhouYu.DreamTour.Web.Models;
@{
    var cashList = ViewBag.cashList as List<CashInfo>;
    var Count = ViewBag.Count as CashInfo;
    var reCount = ViewBag.reCount as CashInfo;
    var cashBalance = ViewBag.cashBalance as Cashnumber;
    var UserInfo = UserInfoContext.userInfoContext.UserInfo;
}
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>中国梦想游-会员登录页</title>
    <link href="~/css/style.css" rel="stylesheet" type="text/css" />
    <link href="~/css/common.css" rel="stylesheet" type="text/css" />
    <link href="~/layui-v2.5.4/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <link href="~/layui-v2.5.4/layui/css/modules/layer/default/layer.css" rel="stylesheet" type="text/css" />
    <link href="~/css/Recharge.css" rel="stylesheet" type="text/css" />
    <link href="~/css/Error.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="~/layui-v2.5.4/layui/layui.js"></script>
    <script type="text/javascript" src="~/layui-v2.5.4/layui/lay/modules/layer.js"></script>
    <script type="text/javascript" src="~/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="~/js/Format.js"></script>
</head>
<body>
    <div class="top_hw clearfix">
        <div class="top_h clearfix" style="width:100%">
            <div class="top_hl" style="margin-left:7%">
                <span>欢迎来到中国梦想游，让你的梦想全程免费自由行！</span> 预定热线：
                <b>0571-63322269</b>
            </div>
            <div class="top_hr" style="margin-right:7%">
                @if (UserInfo == null)
                {
                    <a href="/Home/User_Register">会员注册</a>
                    <span>|</span>
                    <a href="/Home/User_Login">登录</a>
                    <span>|</span>
                    <a href="#">梦想收藏</a>
                    <span>|</span>
                    <a href="#">设为首页</a>
                    @*<a>
                            欢迎你，来到新世界旅行网！
                        </a>*@
                }
                else
                {
                    <a href="/Home/User_Center">会员中心</a>
                    <span>|</span>
                    <a href="#">梦想收藏</a>
                    <span>|</span>
                    <a href="#">设为首页</a>
                    <span>|</span>
                    <a href="/Login/LoginOut">退出</a>
                    <span>|</span>
                    <a>
                        欢迎你，<span>@UserInfo.User_Name</span>来到新世界旅行网！
                    </a>
                }
            </div>
        </div>
    </div>
    <div class="head_w">
        <div class="head_t clearfix">
            <div class="logo">
                <img src="~/images/logo.jpg">
            </div>
            <div class="rx_line">
                <img src="~/images/rx.jpg">
            </div>
        </div>
    </div>
    <div class="mainNav clearfix">
        <ul class="Nav_ul">
            <li>
                <a href="/Home/Index">首页</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Route">旅游路线</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Scenic">旅游景点</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/CateringAccommodation">餐饮住宿</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Traffic_DatailsOne">交通线路</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Group">旅游团购</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Specialty">地方特产</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/AutoGenerationIntro">自动生成简介</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Team_Join">团队简介</a>
                <img src="~/images/nav_line.jpg">
            </li>
            <li>
                <a href="/Home/Itinerary_Details">行程导航</a>
            </li>
        </ul>
    </div>
    <div class="b_wrap">
        <div class="current">
            <span>当前所在地：</span>
            <a href="/Home/Index">首页</a> >>
            <a href="/Home/User_Center">会员中心</a>
        </div>
        <div class="fmember">
            <div class="fmleft">
                <div class="fmleft_top">
                    <img src="~/images/fmbt1.png" border="0">
                </div>
                <div class="fmlist">
                    <ul>
                        <li class="f1">订单中心</li>
                        <li>
                            >>
                            <a href="/Home/User_Order">我的订单</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_Colleague">发布结伴同行</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_Apply">我申请的结伴同行</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_Comment">我的点评</a>
                        </li>
                        <li class="f2">
                            >>
                            <a href="/Home/User_Questions">我的提问</a>
                        </li>
                    </ul>
                    <ul>
                        <li class="f1">我的优惠卡券</li>
                        <li>
                            >>
                            <a href="/Home/User_CashAccount">现金账号</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_AllowanceVol">抵用券</a>
                        </li>
                        <li class="f2">
                            >>
                            <a href="/Home/User_TouristVol">旅游券</a>
                        </li>
                    </ul>
                    <ul>
                        <li class="f1">账户信息</li>
                        <li>
                            >>
                            <a href="/Home/User_Data">个人资料</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_AccountSecurity">账户安全</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_Bank">我的银行卡</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_Integral">我的积分</a>
                        </li>
                        <li>
                            >>
                            <a href="/Home/User_UpdatePwd">修改密码</a>
                        </li>
                        <li class="f2">
                            >>
                            <a href="/Home/User_Address">配送地址</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="fmright">
                <div class="fmr1">
                    <div class="fmr1_top">现金账号</div>
                    <div class="fmr1_m">
                        <div class="ftx">
                            <div class="fjf">
                                账户余额：
                                <a href="#">￥@cashBalance.Cash_balance</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;兑换总金额：
                                <a href="#">
                                    ￥@if (reCount.CashRecord_Money == null)
                                    {<span>0</span>}
                                    else
                                    { <span>@reCount.CashRecord_Money</span>}
                                </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提现总金额：
                                <a href="#">
                                    ￥@if (Count.CashRecord_Money == null)
                                    {<span>0</span>}
                                    else
                                    { <span>@Count.CashRecord_Money</span>}
                                </a>
                                <br />冻结金额：
                                <a href="#">
                                    ￥@if (cashBalance.Cash_freeze == null)
                                    {<span>0</span>}
                                    else
                                    { <span>@cashBalance.Cash_freeze</span>}
                                </a>
                                <br>
                                <input type="image" src="~/images/fbtn7.png" id="Get">&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="image" src="~/images/fbtn5.png" id="Exchange">
                                <a href="#" id="Recharge" style="color:blue;margin-left:42%;font-size:14px">账户充值</a>
                            </div>
                        </div>
                        <div class="fjfr">
                            提现说明：
                            <br>
                            1.可提现金额大于等于200元，可使用银行借记卡提现，需一次性提取；可提现金额大于等于1元，可充入旅游券账户；
                            <br>
                            2.返现总金额于次年的3月31日清零；到期未提取的金额将转为等额旅游券，自动充入当前会员的旅游券账户；
                            <br>
                            3.每月最多可进行1次借记卡提现的操作。
                        </div>
                        <div class="fmyor">
                            <ul>
                                <li>
                                    <a href="/Home/User_CashAccount">兑换记录</a>
                                </li>
                                <li class="f2">提现记录</li>
                            </ul>
                        </div>
                        <div class="fjfr">
                            按日期查询：
                            <input type="text" class="finput4">&nbsp;-&nbsp;
                            <input type="text" class="finput4">&nbsp;&nbsp;
                            <input type="image" src="~/images/fbtn6.png" align="absmiddle">
                        </div>
                        <div class="fjflist">
                            <table border="0" cellpadding="0" cellspacing="0" width="678">
                                <tr bgcolor="#fff7e5">
                                    <td width="113" height="30" align="center">流水编号</td>
                                    <td width="113" height="30" align="center">提现日期</td>
                                    <td width="113" height="30" align="center">审核状态</td>
                                    <td width="113" height="30" align="center">提现渠道</td>
                                    <td width="113" height="30" align="center">操作方式</td>
                                    <td width="113" height="30" align="center">提现金额</td>
                                </tr>
                                @if (cashList != null)
                                {
                                    for (int i = 0; i < cashList.Count; i++)
                                    {
                                        <tr>
                                            <td width="113" height="30" align="center">@cashList[i].CashRecord_Id</td>
                                            <td width="113" height="30" align="center" class="CashRecord_CreateTime">@cashList[i].CashRecord_CreateTime.ToString("yyyy:MM:dd").Replace(":", "-")</td>
                                            @if (cashList[i].CashRecord_State == 1)
                                            {
                                                <td width="113" height="30" align="center">已通过</td>
                                            }
                                            else
                                            {
                                                <td width="113" height="30" align="center">待审核</td>
                                            }
                                            <td width="113" height="30" align="center">@cashList[i].CashRecord_Channel</td>
                                            <td width="113" height="30" align="center">@cashList[i].CashRecord_OperationMethod</td>
                                            <td width="113" height="30" align="center">
                                                <span class="fspan9">￥@cashList[i].CashRecord_Money</span>
                                            </td>
                                        </tr>
                                    }
                                }
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="popOutBg"></div>
    <div class="popOut">
        <span title="关闭"> X </span>
        <table>
            <caption>支付宝充值</caption>
            <tr>
                <td width="120">账户名：</td>
                <td>
                    <input type="text" class="inp" readonly id="loginName" value="@cashBalance.Cash_LoginName" placeholder="请输入账户名" />
                </td>
            </tr>
            <tr>
                <td>充值金额：</td>
                <td>
                    <div class="form-control">
                        <input type="text" id="money" class="inp" placeholder="请输入金额" />
                        <small>e</small>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button" class="login" id="pay" value="充值" />
                </td>
            </tr>
        </table>
    </div>
    <input type="hidden" id="OrderNo" />
</body>
@*<script type="text/javascript" src="~/js/Fly.js"></script>*@
<script>
    $("#pay").onclick = (function () {
        if (CheckCashMoney()) {
            var vNow = new Date();
            var sNow = "";
            sNow += String(vNow.getFullYear());
            sNow += String(vNow.getMonth() + 1);
            sNow += String(vNow.getDate());
            sNow += String(vNow.getHours());
            sNow += String(vNow.getMinutes());
            sNow += String(vNow.getSeconds());
            sNow += String(vNow.getMilliseconds());
            document.getElementById("OrderNo").value = sNow;
            var data = {};
            data.Order_Content = "现金账户充值";
            data.Order_ProInfo = document.getElementById('loginName').value;
            data.Order_Money = document.getElementById('money').value;
            data.Order_No = document.getElementById('OrderNo').value;
            window.location.href = "/User/Useristroute_Notice?Order_Content=" + data.Order_Content + "&&Order_ProInfo=" + data.Order_ProInfo + "&&Order_Money=" + data.Order_Money + "&&Order_No=" + sNow;
        }
    });

        //提现页面按钮点击事件
    $("#Get").onclick = (function () {
        //判断金额是否满足条件
        if (@cashBalance.Cash_balance< 200) {
            layer.msg('提现需要余额大于200元！', {
                title: '提示框',
                icon: 1,
            });
            return;
        }
        location.href = "/Home/CashWithdrawal";
    });


   //兑换旅游卷页面按钮点击事件
    $("#Exchange").onclick = (function () {
        //判断金额是否满足条件
        if (@cashBalance.Cash_balance< 10) {
            layer.msg('兑换需要余额大于10元！', {
                title: '提示框',
                icon: 1,
            });
            return;
        }
        location.href = "/Home/ExchangeTravel";
    });

    function $(param) {
    if (arguments[1] == true) {
        return document.querySelectorAll(param);
    } else {
        return document.querySelector(param);
    }
}
    function ani() {
        $(".popOut").className = "popOut ani";
    }
    $("#Recharge").onclick = function () {
        $(".popOut").style.display = "block";
        ani();
        $(".popOutBg").style.display = "block";
    };
    $(".popOut > span").onclick = function () {
        $(".popOut").style.display = "none";
        $(".popOutBg").style.display = "none";
    };
    $(".popOutBg").onclick = function () {
        $(".popOut").style.display = "none";
        $(".popOutBg").style.display = "none";
    };

    //验证输入是否正确
    function CheckCashMoney() {
        const moeny= document.getElementById('money');
        var reg = /^\d+$|^\d+[.]?\d+$/;
        if (moeny.value == "") {
            setErrorFor(moeny, '金额不能为空');
            return false;
        }
        else if (!reg.test(moeny.value)) {
            setErrorFor(moeny,'格式错误');
            return false;
        }
        return true;
    }

    function setErrorFor(input, message) {
        const formControl = input.parentElement;
        const small = formControl.querySelector('small');
        formControl.className = 'form-control error';
        small.innerText = message;
    }
</script>
</html>

